from myuser.models import MyUser
from weibo.models import Access_Token

import simplejson

def nameused(request):
    name = request.GET['username']
    dic = {}
    if MyUser.all().filter('nickname = ',name).count() == 1:
        dic['status'] = "yes"
        return HttpResponse(simplejson.dumps(dic))
    else:
        dic['status'] = "no"
        return HttpResponse(simplejson.dumps(dic))

def emailused(request):
    email = request.GET['email']
    dic = {}
    if MyUser.all().filter('email=',email).count() == 1:
        dic['status'] = "yes"
        return HttpResponse(simplejson.dumps(dic))
    else:
        dic['status'] = "no"
        return HttpResponse(simplejson.dumps(dic))

"""
"""
def getAvaliableLogin(request):
    """
    according to the self, google, sina
    """

def selflogin(request):
    """
    used for the register user
    """

def selfregister(request):
    """
    register
    """


